package com.java1234.mapper;

import com.java1234.entity.SignRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 签到记录表 Mapper 接口
 * </p>
 *
 * @author zhai
 * @since 2025-05-10
 */
@Mapper
public interface SignRecordMapper extends BaseMapper<SignRecord> {
    @Select("SELECT COUNT(*) > 0 FROM sign_record " +
            "WHERE user_id = #{userId} " +
            "AND DATE(sign_time) = CURRENT_DATE() ")
    boolean checkTodaySigned(@Param("userId") Long userId);
}
